#include <stdio.h>				
#include <stdlib.h>				
#include <ctype.h>				
#include <string.h>				

int yylex(){					
  char     buff[256];				
  int      c, i = 0;				

  while( (c=getchar())==' ' );			
  if( c=='\n'
      ||  c=='.' )  { fprintf(stderr,"%c", c); return c;}
  if( c==EOF  ) { return c; } 	                

  while( isalpha(c) ) {                         
    buff[i++] = c;                              
    c = getchar();                              
  }
  buff[i]   = '\0';				
  fprintf(stderr,"<WORD: %s>", buff);		
  if( c != EOF ) ungetc(c,stdin);		

  return c;				        
}

int main() 		 
{
  int c;

  do 
    {
      c = yylex();  
    } while (c != EOF);

  return EXIT_SUCCESS;
}            

